#include <QApplication>
#include <QMainWindow>
#include <QDesktopWidget> 
#include <QIcon>
#include <QMenuBar>
#include <QMenu>
#include <QAction>
#include <QStatusBar>

#include "face_alignment.h"

using namespace std;

const int DEFAULT_WINDOW_WIDTH = 800;
const int DEFAULT_WINDOW_HEIGHT = 480;
static string DEFAULT_TITLE = "FaceAlignment";
static string DEFAULT_ICON = "icon.png";


class FaceWindow : public QMainWindow
{
    Q_OBJECT

    public:
        FaceWindow(const int width = DEFAULT_WINDOW_WIDTH,
               const int height     = DEFAULT_WINDOW_HEIGHT, 
               const string title   = DEFAULT_TITLE,
               QWidget *parent = 0);

    private:
        /*
         * Put this window to center of screen with width:w and height:h.
         * (x, y): The top left corner point of this window.
         * */
        void centerWindow(const int w, const int h, int &x, int &y);
        void setupMenus();
        void setupLayouts();
        void setupStatusBar();

    private slots:
        void onOpenCamera();
        void onCloseCamera();
        void toggleCamera();

        void onStartAlignment();
        void onStopAlignment();
        void toggleAlignment();

    private:
        string appTitle;
        FaceAlignment *fa;
        QAction *actionCamera;
        QAction *actionAlignment;
};

